<?php
include_once $_SERVER['DOCUMENT_ROOT'].'/functions/bdd/init.php';

function get_apropos(){
	$bdd = bdd_init();
	
	$prep_get_apropos = $bdd->prepare('SELECT * FROM messages WHERE cle=?');
	$prep_get_apropos->execute(array('apropos'));
	$apropos = $prep_get_apropos->fetch();	
	
	return $apropos['value']; 
}

function set_apropos($apropos){
	$cle = 'apropos';
	$bdd = bdd_init();
	
	$prep_set_apropos = $bdd->prepare('UPDATE messages SET value = :value WHERE cle=:cle');
	$prep_set_apropos->bindParam(':cle', $cle);
	$prep_set_apropos->bindParam(':value', $apropos);
	$prep_set_apropos->execute();
}
?>
